package com.tiancheng.trade.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Auther: 李凯伦
 * @Date: 2024/12/15 17:15
 * @Param ${tags}
 * @Description:
 */
@Getter
@AllArgsConstructor
public enum SystemSourceEnum {
	YUNYOUYUN("YUNYOUYUN", "云游云","yyy"),
	YOUYUNNAN("YOUYUNNAN", "平台",""),
	ERHAI_TICKET_WAREHOUSE("ERHAI_TICKET_WAREHOUSE", "洱海票仓",""),
	TOURISM_INVESTMENT("JS_TOURISM_INVESTMENT", "建水旅投",""),
	YUN_PIN("YUNPIN", "云品",""),
	YUNKER("YUNKER", "待客下单","yunker"),
	POWERLIFE("POWERLIFE", "电动生活",""),
	TRAVEL_ASSISTANT("TRAVEL_ASSISTANT", "旅行助手",""),
	;

	private String code;
	private String desc;
	private String cmqTagPrefix;

	public static String getDesc(String code) {
		SystemSourceEnum[] systemSourceEnums = values();
		for (SystemSourceEnum statusEnum : systemSourceEnums) {
			if (statusEnum.code().equals(code)) {
				return statusEnum.desc();
			}
		}
		return null;
	}

	/**
	 * cmq tag 前缀获取
	 * @param code
	 * @return
	 */
	public static String getCmqTagPrefix(String code) {
		SystemSourceEnum[] systemSourceEnums = values();
		for (SystemSourceEnum statusEnum : systemSourceEnums) {
			if (statusEnum.code().equals(code)) {
				return statusEnum.getCmqTagPrefix();
			}
		}
		return null;
	}

	/**
	 * 是否存在系统类型
	 * @param code
	 * @return
	 */
	public static boolean isExitSystem(String code) {
		SystemSourceEnum[] systemSourceEnums = values();
		for (SystemSourceEnum statusEnum : systemSourceEnums) {
			if (statusEnum.code().equals(code)) {
				return true;
			}
		}
		return false;
	}

	public String code() {
		return this.code;
	}

	public String desc() {
		return this.desc;
	}
}
